<template>
    <div>
        <qf-image-cropper ref="qfImageCropper" :width="500" :height="500" :radius="30" @crop="handleCrop"></qf-image-cropper>
    </div>
</template>

<script lang="ts">
	import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue'
    export default {
        components: {
            QfImageCropper
        },
        mounted() {
            this.$refs.qfImageCropper.chooseImage({ sizeType:'compressed',fail:(err)=>{
                    uni.navigateBack()
                } 
            });
        },
        methods: {
            handleCrop(e) {
                const eventChannel = this.getOpenerEventChannel();
                eventChannel.emit('afterCrop', e);
				uni.navigateBack()
            }
        }
    }
</script>